SecondsToEnd Function

private function SecondsToEnd(time) result(second)

Gets the second to the end of the year represented by this instance.

Arguments

Type IntentOptional Attributes Name
type(DateTime), intent(in) :: time

Return Value integer(kind=short)


Source Code

FUNCTION SecondsToEnd &
!
(time) &
!
RESULT (second)

IMPLICIT NONE

! Arguments with intent(in):
TYPE (DateTime), INTENT(IN) :: time

! Local variables:
INTEGER (KIND = short) :: second
!------------end of declaration------------------------------------------------

IF ( IsLeapYear (time % year) ) THEN
  second = 366 * 86400 - SecondOfYear (time) 
ELSE
  second = 365 * 86400 - SecondOfYear (time) 
END IF

END FUNCTION SecondsToEnd